from turbogears            import identity, expose, redirect
from onlineapidoc.model        import User

class UserController(identity.SecureResource):
    require = identity.in_group("root")
    
    @expose(template="onlineapidoc.templates.user.index")
    def index(self, show_others=0):
        return dict(active_section='user')
    
    
    @expose()
    def new_user(self, name, display_name, email, password):
        person = User(display_name=display_name,
                        user_name=name,
                        password=password,
                        email_address=email)
        raise redirect('/user')
